module frontend.Model;
import frontend.Types;
import maths.Vec;
import utils.Memory;
import maths.CoordSys;

class Model {
	vec3[] positions;
	vec3[] normals;
	uint[] indices;
	vec3[][] offsets;
	int[][] bones; 
	float[][] weights;
	Skeleton skeleton;
	CoordSys coordSys;
	
	
	char[] name;
	this(char[] name){
		this.name=name.dup;
		coordSys=CoordSys.identity;
	}
	
	~this(){
		positions.free();
		normals.free();
		indices.free();
	}
	
	void update(){
		
	}
	
	CoordSys getCoordSys(){
		return coordSys;
	}
	
	Model clone(){
		Model twin=new Model(this.name);
		twin.positions=this.positions;
		twin.normals=this.normals;
		twin.indices=this.indices;
		twin.offsets=this.offsets;
		twin.bones=this.bones;
		twin.weights=this.weights;
		twin.skeleton=this.skeleton.cloneSkeleton;
		return twin;
	}
}